#单例设计模式
class Dog(object):

	__test = None
	def __new__(cls, *args, **kwargs):
		if cls.__test is None:		
			cls.__test = object.__new__(cls)							    
		return cls.__test
	def __init__(self,name,feature):
		self.name = name
		self.feature = feature
d1 = Dog('小红','卷毛')
d2 = Dog('小黑','金丝')
print('0x%X' %id(d1))
print('0x%X' %id(d2))
